<script> 
$(document).ready(function(){
	$(".inline").colorbox({inline:true, width:"500px"});
		$("#click").click(function(){ 
			$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
	addFilesUploadEvent();
});
function checkNull(){
	var phone = $('#phone').val();
	var name = $('#name').val();
	if(name.length == 0 ){
		alert("必须填写姓名");
		return
	}
	if(phone.length == 0 ){
		alert("必须填写联系电话");
		return
	}
	apply();
}
function apply(){
	var parm = $('#apply').serialize();
	var url = create_url('recruitinfo-joinrecruitinfo');
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			if ('success' == result) {
				sys_msg('提交成功!');
				cleanText_riDetail();
				$.fn.colorbox.close();
			}
		}
	});
}

function cleanText_riDetail(){
	$('#phone').val("");
    $('#name').val("");
    $('#remark').val("");
}
function addFilesUploadEvent() {
	var url = create_url('recruitinfo-uploads');
	var btn = $('#uploadFilesBtn');
	new AjaxUpload(btn, {
		action:url,
		name:'files',
		multiple: true,
		responseType: 'json',
		onSubmit : function(file, ext) {
			if (ext && /^(zip|rar|txt|doc|docx|xls|xlsx|ZIP|RAR|TXT|DOC|DOCX|XLS|XLSX)$/.test(ext)){
				this.setData({'info':'文件类型正确'});
			} else {
				alert('文件类型错误', '只能上传类型为：zip、rar、txt、doc、docx、xls、xlsx、xlsx、文件！');
				return false;               
			}
			$('#upload_span').html(sys_loading_img);
			this.disable();
		},
		onComplete: function(files, response){
			if ('error' == response.result)
				alert('失败', '上传文件失败，请检查文件名是否正确!');
			else if ('file_type_error' == response.result)
				alert('文件类型错误', '只能上传类型为：zip、rar、txt、doc、docx、xls、xlsx、xlsx、文件!');
			else {
				var template = $('#tempAnnexListDiv').find('.rep');
				var annexList = $('#annexListTable');
				var index = parseInt($('#recruit_an_index').val());
				$.each(response.list, function(i) {
					var pii = template.clone(true);
					pii.find('.title').html(response.list[i].name).end()
						.find('.name').attr('name', 'List[' + (index + i) + '].name').val(response.list[i].name).end()
						.find('.size').attr('name', 'List[' + (index + i) + '].size').val(response.list[i].size).end()
						.find('.sn').attr('name', 'List[' + (index + i) + '].sn').val(response.list[i].path).end()
						.find('.ext').attr('name', 'List[' + (index + i) + '].ext').val(response.list[i].ext).end()
						.find('.afcs').val(response.list[i].code).end();
					annexList.append(pii);
					index ++;
				});
				this.enable();
				$('#recruit_an_index').val(index);
				alert('上传成功！');
				$("#upload").remove();
			}
		}
	});
}
</script>
	<div class="c_contentRight">
		<div class="c_detail">
			<div class="c_detailTitle">
		 		<h1>招聘职位:${(info.post)!''}</h1>
			</div>
			<div class="demandDetail">
			<div class="demandDetailLeft"><img style="width:245px;height:260px;" src="${contextPath}images/parkindex/zhaoping.jpg"  alt=""/></div>
			<div class="demandDetailRight">
				<dl>
					<dt>职 位：</dt>
					<dd>${(info.post)!'无'}</dd>
					<dt>性 别：</dt>
					<dd><#if info.sex==0>不限<#elseif info.sex==1>男<#else>女</#if></dd>
					<dt>年 龄：</dt>
					<dd>${(info.age)!'无'} </dd>
					<dt>学 历：</dt>
					<dd>${(info.eb)!'无'}</dd>
					<dt>专 业：</dt>
					<dd>${(info.major)!'无'}</dd>
					<dt>薪 资：</dt>
					<dd>${(info.wage)!'无'} </dd>
					<dt>招聘人数：</dt>
					<dd>${(info.num)!'无'} </dd>
					<dt>联系电话：</dt>
					<dd>${(info.phone)!'无'} </dd>
					<dt>公司地址：</dt>
					<dd>${(info.address)!'无'} </dd>
					<dt>截止期至：</dt>
					<dd>${(info.stopTime?string('yyyy年MM月dd日'))!''} </dd>
				</dl>
			</div>
			<div class="demandContent" style="width:690px">
				<h2>招聘详情</h2>
				<div class="demandTxt">
			　　	${(info.content)!'无'}
				</div>
			</div>
		</div>
		<div class="clear"></div>
		<div class="participateBtn"><a class='inline' href="#inline_content3" title="">我要应聘</a></div>
		</div>
	</div>
	<div class="clear"></div>
<!-- 弹出框 -->
<div style='display:none'>
		<div id='inline_content3' class="login">
		<form id="apply">
		<input type="hidden" name="rc" value="${(info.code)!''}"/>
			<h2>我要应聘</strong></h2>
			<dl>
				<dt>联系人</dt>
				<dd><input name="name" id="name" type="text" class="loginInput" /></dd>
			</dl>
			<dl>
				<dt>联系电话</dt>
				<dd><input name="phone" id="phone" type="text" class="loginInput" /></dd>
			</dl>
			<dl>
				<dt>留 言</dt>
				<dd><textarea name="remark" id="remark" class="loginInput2"></textarea></dd>
			</dl>
			<dl >
				<dt>可上传简历</dt>
				<dd id="upload"><a id="uploadFilesBtn" href="javascript:;" >[请选择]</a></dd>
				<dd><span id="annexListTable"></span></dd>
			</dl>
			<dl>
				<dt> </dt>
				<dd><input  type="button" value="提 交" class="loginBotton"  onclick="apply()"/></dd>
			</dl>
		</form>
			<div class="clear"></div>
		</div>
</div>
	
<div id="tempAnnexListDiv" style="display:none;">
	<div class="filter-table rep" style="margin-left:5px; margin-bottom:0px;">
		<input class="name" type="hidden" />
		<input class="size" type="hidden" />
		<input class="sn" type="hidden"  />
		<input class="ext" type="hidden"  />
		<input id="afcs" class="afcs" type="hidden" name="afcs" />
		<a class="title" href="#"></a>
	</div>
</div>